--settings
local priority = 1

--local cache
local center  -- cache entity to potentially do something fancy with it

EntitySystem.updatesystem("camera", priority, function(dt) 
    center = player
    for e in pairs(EntitySystem.query("camFollows")) do

      if e.inCam.mode == "follow" then
        --fetch new position
        --local newCenter = Vector.new(e.position.x, e.position.y)
        local newCenter = e
        
        if not center then
          center = newCenter
        end        
      elseif e.inCam.mode == "catch" then
        --entities used for zoom calc ?
          
      end
        
    end
    
    --update if got a pos
    if center then
      if center.position then
        camera:lookAt(center.position.x + center.shape.size.x/100,center.position.y+center.shape.size.y/2)
      end
      
    end
    
end)